package com.kmzx.one.project.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.kmzx.one.project.entity.FrequentlyAskedQuestion;
import com.kmzx.one.project.mapper.FAQMapper;
import com.kmzx.one.project.service.FAQService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FAQServiceImpl implements FAQService {
    @Autowired
    private FAQMapper faqMapper;

    @Override
    public Page<FrequentlyAskedQuestion> findFAQList(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize, true);
        return faqMapper.selectFAQList();
    }

    @Override
    public Page<FrequentlyAskedQuestion> findFrequentlyAskedQuestionsByType(Integer pageNum, Integer pageSize, Integer type) {
        PageHelper.startPage(pageNum, pageSize, true);
        return faqMapper.selectFrequentlyAskedQuestionsByType(type);
    }
}
